package com.flexrrb.core
{
	import mx.core.UIComponent;
	import mx.effects.Effect;
	import mx.managers.IToolTipManagerClient;
	
	public class RRBTooltipConfigItem
	{
		public static const TOOLTIP_STYLE_ANCHOR:String = "tooltipStyleAnchor";
		public static const TOOLTIP_STYLE_SIMPLE:String = "tooltipStyleSimple";
		
		private var _target:IToolTipManagerClient;
		private var _tooltipClass:Class;
		private var _showEffect:Effect;
		private var _hideEffect:Effect;
		
		private var _tooltip:IRRBTooltip;
		
		public function RRBTooltipConfigItem(target:IToolTipManagerClient, tooltipClass:Class=null, showEffect:Effect=null, hideEffect:Effect=null)
		{
			_target = target;
			_tooltipClass = tooltipClass;
			_showEffect = showEffect;
			_hideEffect = hideEffect;
			
		}
		
		public function get showEffect():Effect
		{
			return _showEffect;
		}
		
		public function get hideEffect():Effect
		{
			return _hideEffect;
		}
		
		public function get tooltip():IRRBTooltip
		{
			if(!_tooltip)
			{
				_tooltip = new _tooltipClass();
				_tooltip.target = _target as UIComponent;
				_tooltip.text = _target.toolTip;
				_target.toolTip = "";
			}
			
			return _tooltip;
		}
		
		public function get target():IToolTipManagerClient
		{
			return _target;
		}
	}
}